#ifndef MYPROGRESSBAR_H
#define MYPROGRESSBAR_H

#include <QtGui/QWidget>

#include "Define.h"
#include "FileKey.h"

namespace Ui {
    class MyProgressBar;
}

class MyProgressBar : public QWidget {
    Q_OBJECT

	public:
		MyProgressBar(QWidget *parent = 0);
		MyProgressBar(FileKey key, long long size, QWidget *parent = 0);
		~MyProgressBar();
		void Initialize();
		void SetValue(int size);
		void EnableButton();

	protected:
		void changeEvent(QEvent *e);

	private:
		Ui::MyProgressBar *m_ui;

		QString _fileName;
		QHostAddress _addr;
		Mode _mode;

		FileKey _key;
		long long _size;
		bool _fin;

	private slots:
		void on_pushButton_clicked();
		void on_button_stop_clicked();

	signals:
		void sigDestroyProgressBar(FileKey key);
};

#endif // MYPROGRESSBAR_H
